const express = require('express');
//引入连接池模块
const pool = require('../pool.js');
//创建路由器对象
const router = express.Router();
//4.常见问题列表(get /)
router.post('/upload', (req, res) => {
  //4.5执行SQL命令
  pool.query('select * from articlelist', (err, result) => {
    if (err) {
      console.log(err);
      res.send({ code: 500, msg: '服务器端错误' });
      return;
    }
    res.send({ code: 200, msg: '查询成功', data: result });
  });
});
//导出路由器对象
module.exports = r;